<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str="this is a boX BOX bOX Box";
        var reg=/box/ig;
        // search方法
        console.log(str.search(reg));
        // match方法
        console.log(str.match(reg));
        // replace方法
        console.log(str.replace(reg,"*"));
        // split方法
        console.log(str.split(/\s/));

    </script>
</body>
</html>